<?php 
// check time to load the page
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;
error_reporting(E_ALL);
//PROJECT start DATA 17/06/2010
include('smartic/smartic.php');
// new class
$S = new smartic();
// fields validation
$S->text('[name=username][trim][required]')
  ->length(2,20)
  ->regex('arabic');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Smartic form validation</title>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>-->
</head>
<body>
<pre>
<?php
print_r($S->getElementInfo());
?>
</pre>
<form action="" method="post">
  <table border="0" cellspacing="5" cellpadding="5">
    <tr>
      <td> Username </td>
      <td><?php $S->render('username'); ?></td>
      <td><?php $S->showerror('username'); ?></td>
    </tr>
    <tr>
      <td> age </td>
      <td><?php //$S->render('age'); ?></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
  </table>
</form>
</body>
</html>
<?php
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ("This page took %f seconds to load.", $totaltime);
?>